package com.alibaba.travel.member.Utils;

import com.alibaba.travel.member.entity.UserEntity;

public class UserHolder {
    private static final ThreadLocal<UserEntity> tl = new ThreadLocal<>();
    public static void saveUser(UserEntity user){
        tl.set(user);
    }
    public static UserEntity getUser(){
        return tl.get();
    }
    public static void removeUser(){
        tl.remove();
    }

}
